.TH E1432_READ_I2C 3 E1432
.SH NAME
.nf
e1432_read_i2c \- Read from input I2C port
e1432_write_i2c \- Write to input I2C port
.fi
.IX  e1432_read_i2c(3) 3
.IX  e1432_write_i2c(3) 3
.SH SYNOPSIS
.cS
SHORTSIZ16 e1432_read_i2c(E1432ID hw, SHORTSIZ16 ID,
                          SHORTSIZ16 addr, SHORTSIZ16 *value)
SHORTSIZ16 e1432_write_i2c(E1432ID hw, SHORTSIZ16 ID,
                           SHORTSIZ16 addr, SHORTSIZ16 value)
.cE
.SH DESCRIPTION

This is a low-level function which will not normally be needed by an
application programmer.  These functions are not necessary for the
E3242A Charge Break-Out Box, nor for the E3243A Microphone Break-Out
Box.

To use the input channel on an E1432 module, a cable must connect a
"break-out" box to the small connectors on the front panel of the
E1432.  Several break-out boxes are available.  Some are passive, and
provide only a direct connection from a BNC connector to the E1432
input channel.  Some are "smart", and can perform some analog signal
conditioning before sending the signal to the E1432 input channel.

The smarter break-out boxes use I2C to communicate setup information
between the E1432 module and the break-out box.  For the most part,
the E1432 module has built-in knowledge of how to talk to a break-out
box, and will encapsulate the functionality of the break-out box.
However, future break-out boxes might provide functionality that the
E1432 module is unaware of.  In this case, it may be useful for a host
program to directly program the break-out box by reading and writing
on the I2C bus.  \fIe1432_read_i2c\fR and \fIe1432_write_i2c\fR
provide this capability.

\fIe1432_read_i2c\fR will read any I2C address on the I2C bus attached
to a particular SCA (the \fIID\fR identifies which SCA).

\fIe1432_write_i2c\fR will write any value to any I2C address on the
I2C bus attached to a particular SCA.

\fIhw\fR must be the result of a successful call to
\fIe1432_assign_channel_numbers\fR, and specifies the group of
hardware to talk to.

\fIID\fR is either the ID of a group of channels that was obtained
with a call to \fIe1432_create_channel_group\fR, or the ID of a single
channel.  Each SCA in an E1432 module can have a different break-out
box attached.  The \fIID\fR identifies which break-out box to talk to
- the ID of any channel of an SCA identifies the break-out box
attached to that SCA.

\fIaddr\fR specifies the I2C address to talk to.  I2C addresses
contain seven bits of address, which should be shifted up one bit so
that the bottom bit of the address is always zero.  The bits above the
bottom eight are ignored.

When reading, \fIvalue\fR is a pointer to a 16-bit integer which will
be filled in with the value read.  The value read is really only an
8-bit quantity.

When writing, \fIvalue\fR is a 16-bit integer which specifies the
value to write.  Only the bottom eight bits are actually written.

.SH "RESET VALUE"
None.
.SH "RETURN VALUE"
Return 0 if successful, a (negative) error number otherwise.
